import globaljs from "@/api/global.js";
import common from '@/utils/common.js'
//加载站点围栏数据
const loadSpotList = async (token) => {
	let res = await globaljs.getSpotList(true, token);
	if (common.httpIsWrong(res)) return [];
	return res.json.data.data;
}

//退出方法
const quit = async (token) => {
	let res = await globaljs.quit(token);
	common.httpIsWrong(res);
	uni.redirectTo({
		url: '/pages/index/index'
	});
}

module.exports = {
	loadSpotList,
	quit
}